Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update JSON schema migration to require id, created, and updated on responses #16391

Merged
merged 3 commits into from
Dec 24, 2024

Conversation

desertaxle
Copy link
Member

@desertaxle desertaxle commented Dec 15, 2024

The generated client for the v2 UI has been showing id, created, and updated as optional for a response from the API, even though they should always be present. I tracked this down to the response models inheriting from ORMBaseModel, which has default factories for these three fields. The default factories will cause these fields to appear optional in the generated OpenAPI schema.

This PR customizes the JSON schema generation for ORMBaseModel and IDBaseModel to ensure that id, created, and updated appear as required in the generated JSON schema. This is reflected in the changes to the generated UI client code. Any other UI changes are to account for type errors from the new typing.

@desertaxle desertaxle force-pushed the fix-optional-ids-open-api branch from 3aa1432 to 73925d8 Compare December 15, 2024 04:38
Copy link

codspeed-hq bot commented Dec 15, 2024

CodSpeed Performance Report

Merging #16391 will not alter performance

Comparing fix-optional-ids-open-api (bc6428b) with main (8d506b2)

Summary

✅ 3 untouched benchmarks

Copy link
Collaborator

@aaazzam aaazzam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hallelujah

@desertaxle desertaxle merged commit 2fada4c into main Dec 24, 2024
45 checks passed
@desertaxle desertaxle deleted the fix-optional-ids-open-api branch December 24, 2024 16:03
devinvillarosa pushed a commit that referenced this pull request Dec 24, 2024
devinvillarosa pushed a commit that referenced this pull request Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs ui-replatform Related to the React UI rewrite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants